# include <bits/stdc++.h>
using namespace std;
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    long long a,b[1010111];
    cin>>a;
    for(int i=0;i<a;i++){
        cin>>b[i];
    }
    sort(b+0,b+a);
    long long s=a;
    for(int i=0;i<a-1;i++){
        if(b[i]<b[i+1]){
            s-=1;
        }
    }
    cout<<s-1;
    fclose(stdin);
    fclose(stdout);
    return 0;
}
